package com.xs.designpattern;

/**
 * @author xs
 */
public class Main {
    public static void main(String[] args) {
        // 创建政党和成员
        Party party = new PartyImpl();
        PartyMember hobbit = new Hobbit();
        PartyMember wizard = new Wizard();
        PartyMember rogue = new Rogue();
        PartyMember hunter = new Hunter();

        // 添加党员
        party.addMember(hobbit);
        party.addMember(wizard);
        party.addMember(rogue);
        party.addMember(hunter);

        // 执行行动 -> 该组织成员通知其他组织成员
        hobbit.act(Action.ENEMY);
        wizard.act(Action.TALE);
        rogue.act(Action.GOLD);
        hunter.act(Action.HUNT);
    }
}